import 'package:flutter/material.dart';

class NotifyManager with ChangeNotifier {
  showError(BuildContext context, String message) {
    return showDialog<bool>(
      //barrierDismissible: false,
      context: context,
      builder: (context) {
        return AlertDialog(
          backgroundColor: Colors.black45,
          contentTextStyle: TextStyle(color: Colors.white),
          content: Text('$message'),
          actions: <Widget>[
            TextButton(
              onPressed: () {
                Navigator.pop(context, false);
              },
              child: Text('确定',style: TextStyle(color: Colors.white),),
            )
          ],
        );
      },
    );
  }

  static showInfo(BuildContext context, String message, {int timesSec = 1}) {
    // Fluttertoast.showToast(
    //     msg: message,
    //     toastLength: toastLength,
    //     gravity: ToastGravity.CENTER,
    //     backgroundColor: Color(0xCC333333),
    //     textColor: Colors.white);
    // //TODO:使用不同的方法定制不同提示层
  }

  static showToast( String message, {int timesSec = 1}) {
  //   Fluttertoast.showToast(
  //       msg: message,
  //       toastLength: toastLength,
  //       gravity: gravity,
  //       backgroundColor: Color(0xCC333333),
  //       textColor: Colors.white);
  //   //TODO:使用不同的方法定制不同提示层
  }
}
